package com.wiscamp.ninechapters.panels.domain.repositories;

import com.wiscamp.ninechapters.panels.domain.entities.Group;
import cube.ddd.common.query.PagedObjects;
import cube.ddd.common.query.PagedQuery;

import java.util.Collection;

public interface GroupRepository {

    Group getGroup(long groupId);

    Group getGroupByCode(long appId, String groupCode);

    Collection<Group> getGroupsByName(long appId, String groupName);

    Collection<Group> getGroupsByIds(Collection<Long> groupIds);

    PagedObjects<Group> getGroupsByQuery(PagedQuery query);

    Group saveGroup(Group group);

    boolean bindGroupRole(long groupId, long roleId);

    boolean unbindGroupRole(long groupId, long roleId);

    boolean bindGroupUser(long groupId, long userId);

    boolean unbindGroupUser(long groupId, long userId);
}
